package 约定编程;


import java.lang.reflect.InvocationTargetException;

/**
 * @author zyl
 * @Description
 * @since 2024/1/24 15:03
 */

public class Myinterceptor implements Interceptor{
    @Override
    public boolean before() {
        System.out.println("*****Before*****");
        return true;
    }

    @Override
    public void after() {
        System.out.println("*****after*****");
    }


    @Override
    public Object around(Invocation invocation) throws InvocationTargetException,IllegalAccessException{
        System.out.println("*****around Before*****");
        Object proceed = invocation.proceed();
        System.out.println("*****around after*****");
        return proceed;
    }

    @Override
    public void afterReturning() {
        System.out.println("*****afterReturning*****");
    }

    @Override
    public void afterThrowing() {
        System.out.println("*****afterThrowing*****");
    }

    @Override
    public boolean userAround() {
        System.out.println("*****userAround*****");
        return true;
    }
}
